<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script src="../js/chop1.js" type="text/javascript"></script>
		<input type="button" value="点击" onclick="javascript:alert('弹出框')"/>		
		<script type="text/JavaScript">
		/*alert("弹出信息");
		prompt("输入信息","默认值");*/
		function a(){
			var a=12;
			return a;
		}
		var c=12;
		//alert(typeof(c));
		//object
		var c=[1,12,12];
		//alert(typeof(c));
		for(var i in c){
			document.write(c[i]+"<br/>");
		}
		var a= parseInt("12.12");
		document.write(typeof(a));
		document.write(a);
		var a=parseFloat("12.12");
		document.writeln(typeof(a));
		document.writeln(a);
		document.write("<h1>字符串</h2>")
		var info="abcdefg";
		document.write(info.length+"<br/>");
		document.write(info.charAt(2)+"<br/>");
		document.write(info.indexOf("b")+"<br/>");
		document.write(info.indexOf("b",3)+"<br/>");
		document.write(info.substring(1,4)+"<br/>");
		var str="this is a dog,the name is wangwang";
		var strs=str.split(" ");
		for(var i in strs){
			document.write(strs[i]+" ");
		}
		var c=[21,12,12];
		document.write(c.sort()+"<br />");
		document.write(c.push("das","ada")+"<br/>");
		document.write(c.join("。")+"<br/>");
		for(var a in c){
			document.write(a+" "+c[a]+"<br />");
		}
		var shuzhu=new Array(2);
		shuzhu[1]=12;
		shuzhu[2]="string";
		for(var i=0;i<shuzhu.length+12;i++){
			document.write(shuzhu[i]+" ");
		}
		for(var i in shuzhu){
			document.write(shuzhu[i]+" ");
		}
		function factorial(aNumber) {
				aNumber = Math.floor(aNumber); // 如果这个数不是一个整数，则向下舍入。
				if(aNumber < 0) { // 如果这个数小于 0，拒绝接收。
					return -1;
				}
				if(aNumber == 0) { // 如果为 0，则其阶乘为 1。
					return 1;
				} else{
					return(aNumber * factorial(aNumber - 1)); // 否则，递归直至完成。
				}
			}
		document.write("<br />"+factorial(12));
		</script>
	</body>
</html>
